<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/mall/CampHouseBase.js此处编写
 -->
<template>
  <div>
    <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields" :editFormFileds="editFormFields" :editFormOptions="editFormOptions"
      :searchFormFields="searchFormFields" :searchFormFileds="searchFormFields" :searchFormOptions="searchFormOptions" :table="table" :extend="extend">
    </view-grid>
  </div>
</template>

<script>
import extend from '@/extension/mall/CampHouseBase.js'
import ViewGrid from '@/components/basic/ViewGrid.vue'
var vueParam = {
  components: {
    ViewGrid,
  },
  data() {
    return {
      table: {
        key: 'id',
        footer: 'Foots',
        cnName: '营房管理',
        name: 'CampHouseBase',
        url: '/CampHouseBase/',
        sortName: 'createDate',
      },
      extend: extend,
      editFormFields: {
        supplierCode: '',
        type: '',
        name: '',
        position: '',
        cover: [],
        contact: '',
        contactPhone: '',
        detail: '',
        desc: '',
        campUnitId: '',
      },
      editFormOptions: [
        [
          { dataKey: 'mall_supplier_camp', data: [], title: '供应商', required: true, field: 'supplierCode', type: 'select' },
          { title: '单位ID', field: 'campUnitId', type: 'text', required: true },
        ],
        [
          { title: '营房名称', required: true, field: 'name', type: 'text' },
          { dataKey: 'CampsiteHouseType', data: [], title: '营房类型', required: true, field: 'type', type: 'select' },
        ],
        [
          { title: '封面图', field: 'cover', type: 'imgupgrade', maxSize: 1, maxFile: 1, multiple: true },
          { title: '详情介绍', field: 'desc', type: 'select', dataKey: 'mall_test', data: [] },
        ],
        [
          { title: '联系人', field: 'contact', type: 'text' },
          { title: '联系人手机号', field: 'contactPhone', type: 'phone' },
        ],
        [
          { title: '位置', field: 'position', type: 'text' },
          { title: '营房描述', field: 'detail', type: 'textarea' },
        ],
      ],
      searchFormFields: { name: '', type: '' },
      searchFormOptions: [
        [
          { title: '营房名称', field: 'name', type: 'like' },
          { dataKey: 'CampsiteHouseType', data: [], title: '营房类型', field: 'type', type: 'select' },
        ],
      ],
      columns: [
        { field: 'name', title: '营房名称', type: 'string', width: 220, require: true, align: 'left' },
        { field: 'type', title: '营房类型', type: 'int', bind: { key: 'CampsiteHouseType', data: [] }, width: 90, require: true, align: 'left' },
        {
          field: 'supplierCode',
          title: '供应商编码',
          type: 'string',
          bind: { key: 'mall_supplier_camp', data: [] },
          width: 220,
          require: true,
          align: 'left',
        },
        { field: 'contact', title: '联系人', type: 'string', width: 220, align: 'left', sortable: true },
        { field: 'contactPhone', title: '手机号', type: 'string', width: 220, align: 'left' },
        { field: 'cover', title: '封面图', type: 'imgupgrade', width: 220, align: 'left' },
        { field: 'creator', title: '创建人', type: 'string', width: 120, align: 'left' },
        { field: 'createDate', title: '创建时间', type: 'datetime', width: 190, align: 'left', sortable: true },
        //    {field:'desc',title:'营房图文介绍',type:'string',width:220,align:'left'},
        { field: 'detail', title: '营房描述', type: 'string', width: 220, align: 'left' },
        { field: 'modifier', title: '修改人', type: 'string', width: 120, align: 'left' },
        { field: 'modifyDate', title: '修改时间', type: 'datetime', width: 190, align: 'left', sortable: true },
        { field: 'position', title: '位置', type: 'string', width: 220, align: 'left' },
      ],
      detail: {
        cnName: '营位',
        columns: [
          { field: 'name', title: '房型名称', type: 'string', width: 90, align: 'left', edit: { type: 'text', keep: true, required: true } },
          {
            field: 'houseType',
            title: '房型',
            type: 'select',
            width: 90,
            align: 'left',
            edit: { type: 'select', keep: true, required: true },
            bind: { key: '', data: [] },
          },
          {
            field: 'timeContainer',
            title: '起止时间',
            type: 'is-range',
            width: 150,
            align: 'left',
            edit: { type: 'is-range', keep: true, required: true },
          },
          { field: 'dayNum', title: '是否跨天', type: 'int', width: 100, edit: { type: 'switch', keep: true } },
        ],
        sortName: 'createDate',
        key: 'id',
      },
    }
  },
}
export default vueParam
</script>
